<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AuthController;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/


Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});
 
Route::group([
    'middleware' => 'api',
    'prefix' => 'auth'
], function () {
    Route::post('login', [AuthController::class, 'login']);
    Route::post('logout', [AuthController::class, 'logout']);
    Route::post('refresh', [AuthController::class, 'refresh']);
    Route::post('me', [AuthController::class, 'me']);
});

Route::any('login',function(){
    return response()->json([
        'code' => 401,
        'msg'  => 'no auth',
    ], 401)->throwResponse();
})->name('login');

Route::any('test', 'App\Http\Controllers\IndexController@test');
Route::any('/ws/bind', 'App\Http\Controllers\IndexController@bind');
Route::any('/banner/index', [App\Http\Controllers\BannerApiController::class, 'index']);
Route::any('/sms/send', [App\Http\Controllers\SmsApiController::class, 'send']);
Route::any('/banner/index', [App\Http\Controllers\BannerApiController::class, 'index']);
Route::any('/wx_pay/pay', [App\Http\Controllers\WxPayApiController::class, 'pay']);
Route::any('/banner/index', [App\Http\Controllers\BannerApiController::class, 'index']);
Route::any('/version/index', [App\Http\Controllers\VersionApiController::class, 'index']);
Route::any('/banner/index', [App\Http\Controllers\BannerApiController::class, 'index']);
Route::any('/banner/index', [App\Http\Controllers\BannerApiController::class, 'index']);
Route::any('/banner/index', [App\Http\Controllers\BannerApiController::class, 'index']);
Route::any('/banner/index', [App\Http\Controllers\BannerApiController::class, 'index']);
Route::any('/banner/index', [App\Http\Controllers\BannerApiController::class, 'index']);
Route::any('/banner/index', [App\Http\Controllers\BannerApiController::class, 'index']);
Route::any('/banner/index', [App\Http\Controllers\BannerApiController::class, 'index']);
Route::any('/mg_banner/index', [App\Http\Controllers\MgUpBannerApiController::class, 'index']);
